package com.cg.service;

import com.cg.mapper.EventMapper;
import com.cg.pojo.entity.EventEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EventService {


    @Autowired
    EventMapper eventMapper;
//
    public void add(EventEntity event) {
        eventMapper.add(event);
    }

    public List<EventEntity> searchEvents(Integer userId, String title, Integer categoryId, String level, String status) {
        return eventMapper.searchEvents(userId, title, categoryId, level, status);
    }
    public void updateStatus_zf(Integer eventId) {
        eventMapper.updateStatus_zf(eventId);
    }


    public void updateStatus(Integer eventId, String status) {
        eventMapper.updateStatus(eventId, status);
    }


    public void delete(Integer eventId) {
        eventMapper.delete(eventId);
    }

//listByUser
    public List<EventEntity> listByUser(Integer userId) {
        return eventMapper.listByUser(userId);
    }
    public EventEntity getEventById(Integer eventId) {
        return eventMapper.getEventById(eventId);
    }

    public void update(EventEntity event) {
        eventMapper.update(event);
    }
}